package com.pfm.graficos;

import min3d.animation.AnimationObject3d;
import min3d.core.RendererActivity;
import min3d.parser.IParser;
import min3d.parser.Parser;
import min3d.vos.Light;
import min3d.vos.Number3d;

public class LoadMultiMD2 extends RendererActivity {
private AnimationObject3d revenant;
private AnimationObject3d fatso;

@Override
public void initScene() {		
	IParser parser = Parser.createParser(Parser.Type.MD2,
			getResources(), "com.pfm.cuento:raw/revenant", true);
	parser.parse();

	revenant = parser.getParsedAnimationObject();
	revenant.position().x = -1;
	revenant.scale().x = revenant.scale().y = revenant.scale().z = .03f;
	revenant.rotation().z = -90;
	revenant.rotation().x = -90;
	scene.addChild(revenant);

	parser = Parser.createParser(Parser.Type.MD2, 
			getResources(), "com.pfm.cuento:raw/fatso", true);
	parser.parse();
	
	fatso = parser.getParsedAnimationObject();
	fatso.scale().x = fatso.scale().y = fatso.scale().z = .03f;
	fatso.position().x = 1;
	fatso.rotation().z = -90;
	fatso.rotation().x = -90;
	scene.addChild(fatso);
	
	Light light = new Light();
	scene.lights().add(light);
	
	scene.camera().position.y = 1;
	scene.camera().target = new Number3d(0, 1, 0);
	
	revenant.setFps(20);
	revenant.play();
	fatso.setFps(30);
	fatso.play();
}
}
